#ifndef MOZHU_HEXREADER
#define MOZHU_HEXREADER

#include <stdint.h>
#include <vector>

/************************************************************************************
 *@brief:use eight uint8_t to create a uint32_t                                     *
 *@param arr[4]:uint8_t arr,input source number                                     *
 *@param dir:if use aa bb cc dd create ddccbbaa,the dir is 0,otherwise the dir is 1 *
 ************************************************************************************/
uint32_t readLONG(uint8_t arr[4],bool dir = 0);
uint32_t readLONG(std::vector<uint8_t> arr,int startposion,bool dir = 0);


/************************************************************************************
 *@brief:use four uint8_t to create a uint32_t                                      *
 *@param arr[4]:uint8_t arr,input source number                                     *
 *@param dir:if use aa bb cc dd create ddccbbaa,the dir is 0,otherwise the dir is 1 *
 ************************************************************************************/
uint32_t readDWORD(uint8_t arr[4],bool dir = 0);
uint32_t readDWORD(std::vector<uint8_t> arr,int startposion,bool dir = 0);


/************************************************************************************
 *@brief:use two uint8_t to create a uint16_t                                       *
 *@param arr[2]:uint8_t arr,input source number                                     *
 *@param dir:if use aa bb create bbaa,the dir is 0,otherwise the dir is 1           *
 ************************************************************************************/
uint16_t readWORD(uint8_t arr[2],bool dir = 0);
uint16_t readWORD(std::vector<uint8_t> arr, int startposion,bool dir = 0);

#endif